package com.design.pattern.proxy.dynamic;

import com.design.pattern.proxy.statics.AboutRoomPerson;
import com.design.pattern.proxy.statics.RoomOwner;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

public class DynamicTest<T> {
    public static void main(String[] args) {
        AboutRoomPerson owner=new RoomOwner();
        InvocationHandler invocationHandler=new RoomProxy<AboutRoomPerson>(owner);
        AboutRoomPerson doUser= (AboutRoomPerson) Proxy.newProxyInstance(owner.getClass().getClassLoader(),owner.getClass().getInterfaces(),invocationHandler);
        doUser.sale(700);
    }
}
